{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
<script type="text/javascript">
$(function(){
     $('#type_form').validate({
        onkeyup : false,
		onfocusout : false,
        rules : {
			type_name: {
				required: true,
				remote: 'index.php?app=factory&act=check_type&type_name=' + $('#type_name').val(){if $smarty.get.act eq 'edit_type'} + '&type_id={$smarty.get.type_id}'{/if}
			}
		},
		messages : {
			type_name: {
				required: '{$lang.type_name_not_empty}',
				remote: '{$lang.type_name_is_exist}'
			}
		}
	 });
});
</script>
<style>
label.error {margin-left:2em; color:#FF0000;}
</style>
<body>
<div class="sub-body">
<div class="tab-frame">
<div class="tab-title-1">
<!--{if $smarty.get.act eq 'add_type'}--><span>{$lang.add_new_type}</span><!--{else}--><span>{$lang.edit_type}</span><!--{/if}-->
</div>
<form action="{url index.php?app=factory&act=$smarty.get.act}{if $smarty.get.type_id}&amp;type_id={$smarty.get.type_id}{/if}" method="post" id="type_form">
<table cellspacing="0" cellpadding="0" class="tab-display">
	<tr>
		<th width="100" align="right">{$lang.type_name}：</th>
		<td align="left"><input type="text" name="type_name" id="type_name" value="{$type.type_name}" class="input-1" /></td>
	</tr>
	<tr>
		<th align="right">{$lang.if_show}：</th>
		<td align="left"><label><input type="radio" name="if_show" value="1" {if $type.if_show == 1}checked="checked"{/if} />{$lang.yes}</label>&nbsp;&nbsp;&nbsp;&nbsp;<label><input type="radio" name="if_show" value="0" {if $type.if_show == 0}checked="checked"{/if} />{$lang.no}</label></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><input type="submit" value="{$lang.submit}" class="btn-2" /></td>
	</tr>
</table>
</form>
<script language="javascript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
</div>
</div>
</body>
</html>